﻿<views:MvxWpfView 
    x:Class="Sidvall.IdentityManager.UI.Wpf.Views.UserConfigurationView"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"  
    xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:vms="clr-namespace:Sidvall.IdentityManager.UI.ViewModels;assembly=Sidvall.IdentityManager.UI"
    xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf"
    xmlns:Converters1="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Converters" 
    xmlns:Custom="http://schemas.odyssey.com/wpf" 
    xmlns:local="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Views"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:Controls="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Controls" 
    mc:Ignorable="d" 
    d:DesignHeight="500" d:DesignWidth="800">

    <views:MvxWpfView.Resources>
        <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <Converters:BooleanToVisibilityConverter x:Key="NotBooleanToVisibilityConverter" Not="True"/>
        <Converters1:BooleanToWindowStateConverter x:Key="BooleanToWindowStateConverter"/>
    </views:MvxWpfView.Resources>

    <Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:UserConfigurationViewModel}}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition/>
            </Grid.RowDefinitions>

            <Controls:HeaderControl HeaderCaption="Settings" />

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition/>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TabControl Grid.Row="1">
                            <TabItem Header="Information" FontWeight="Bold">
                                <ContentControl FontWeight="Normal">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>

                                        <Controls:SubHeaderControl HeaderCaption="General" />
                                        <Grid Grid.Row="1">
                                            <StackPanel Grid.Row="0">
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition Width="200 "/>
                                                        <ColumnDefinition Width="80" />
                                                        <ColumnDefinition />
                                                    </Grid.ColumnDefinitions>

                                                    <Label Content="Start page"/>
                                                    <ComboBox Grid.Column="1" ItemsSource="{Binding PageTypes}" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveEntity.StartPageId}"/>
                                                </Grid>
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition />
                                                    </Grid.ColumnDefinitions>

                                                    <TextBlock Grid.Column="0" VerticalAlignment="Center" Padding="5">
                                                        <Hyperlink Command="{Binding ShowNewsCommand}">
                                                            View news
                                                        </Hyperlink>
                                                    </TextBlock>
                                                    <CheckBox Grid.Column="1" IsChecked="{Binding ActiveEntity.ShowNewsAtStartup}" VerticalContentAlignment="Center" Padding="0" VerticalAlignment="Center">
                                                        Show news at startup
                                                    </CheckBox>
                                                </Grid>
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>

                                                    <Label Content="Plugin Path"/>
                                                    <TextBox Grid.Column="1" ToolTip="Folder where plugins for the tool are stored.&#x0a;Plugins are classes that implement&#x0a;Sidvall.IdentityManager.IPlugin." Text="{Binding ActiveEntity.PluginPath}" />
                                                    <Controls:ButtonControl Grid.Column="2" ImageHeight="24" ImageWidth="24" ImageSource="/Sidvall.IdentityManager.UI.Wpf;component/Images/Open.png" 
                                                        ToolTip="Open folder" ButtonCommand="{Binding OpenFolderCommand}" />
                                                </Grid>
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition />
                                                    </Grid.ColumnDefinitions>
                                                    
                                                    <Button Grid.Column="1" Command="{Binding ImportPluginsCommand}" Padding="10,1">
                                                        <Grid>
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="Auto" />
                                                                <ColumnDefinition />
                                                            </Grid.ColumnDefinitions>

                                                            <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Import.png" Width="24"/>
                                                            <TextBlock Grid.Column="1" Text="Import Plugins" Margin="5,0,0,0" />
                                                        </Grid>
                                                    </Button>
                                                </Grid>
                                            </StackPanel>
                                        </Grid>
                                        <Controls:SubHeaderControl Grid.Row="2" HeaderCaption="Server" Margin="0,5,0,0" />
                                        <Grid Grid.Row="3">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>

                                            <StackPanel Grid.Row="0">
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition />
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>

                                                    <Label Content="Server"/>
                                                    <ComboBox Grid.Column="1" ItemsSource="{Binding ActiveEntity.ServerItems}" SelectedValuePath="ServerItemId" DisplayMemberPath="Name" SelectedValue="{Binding ActiveServerItemId}" />
                                                    <Button Grid.Column="2" Command="{Binding AddServerItemCommand}" Padding="10,1" Margin="5,0,0,0">
                                                        <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Add.png" Width="24" ToolTip="Register new server"/>
                                                    </Button>
                                                    <Button Grid.Column="3" Command="{Binding DeleteServerItemCommand}" IsEnabled="{Binding CanDeleteServerItem}" Padding="10,1" Margin="5,0,0,0">
                                                        <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Delete.png" Width="24" ToolTip="Remove server registration"/>
                                                    </Button>
                                                </Grid>
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition Width="200" />
                                                        <ColumnDefinition Width="80" />
                                                        <ColumnDefinition />
                                                    </Grid.ColumnDefinitions>

                                                    <Label Content="Type"/>
                                                    <ComboBox Grid.Column="1" ItemsSource="{Binding ConnectionTypes}" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveServerItem.ConnectionTypeId}"/>
                                                </Grid>
                                                <Grid Margin="5,5,5,0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="130" />
                                                        <ColumnDefinition />
                                                    </Grid.ColumnDefinitions>

                                                    <Label Grid.Column="0" Content="Name"/>
                                                    <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.Name}" />
                                                </Grid>
                                                <StackPanel Visibility="{Binding ShowRemoteServer, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="Address"/>
                                                        <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.RemoteAddress}" />
                                                    </Grid>
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="STS Address"/>
                                                        <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.STSAddress}" />
                                                    </Grid>
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="STS Client Id"/>
                                                        <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.STSClientId}" />
                                                    </Grid>
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="STS Client Secret"/>
                                                        <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.STSClientSecret}" />
                                                    </Grid>
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition Width="200" />
                                                            <ColumnDefinition Width="80" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="2-Factor Type"/>
                                                        <ComboBox Grid.Column="1" ItemsSource="{Binding TwoFactorProviders}" SelectedValuePath="Value" DisplayMemberPath="Key" 
                                                                  SelectedValue="{Binding ActiveServerItem.TwoFactorProvider}" />
                                                    </Grid>
                                                </StackPanel>
                                                <StackPanel Visibility="{Binding ShowSqlServerServer, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
                                                    <Grid Margin="5,5,5,0">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="130" />
                                                            <ColumnDefinition />
                                                        </Grid.ColumnDefinitions>

                                                        <Label Content="Connection string"/>
                                                        <TextBox Grid.Column="1" Text="{Binding ActiveServerItem.ConnectionString}" 
                                                         ToolTip="Exempel:&#x0a;Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;&#x0a;Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"/>
                                                    </Grid>
                                                </StackPanel>
                                            </StackPanel>
                                            <Grid Grid.Row="1" Margin="5,5,5,5">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="130" />
                                                    <ColumnDefinition />
                                                </Grid.ColumnDefinitions>

                                                <Label Content="Status"/>
                                                <TextBox Grid.Column="1" IsReadOnly="True" Text="{Binding ActiveServerItem.StatusMessageServer, Mode=OneWay}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" />
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </ContentControl>
                            </TabItem>
                            <TabItem Header="Emails" FontWeight="Bold">
                                <ContentControl FontWeight="Normal">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>

                                        <Grid Grid.Row="0" Margin="5,5,5,0">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="140" />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <Label Grid.Column="0" Content="Smtp Server"/>
                                            <TextBox Grid.Column="1" Text="{Binding ActiveEntity.SmtpServer}" />
                                        </Grid>
                                        <Grid Grid.Row="1" Margin="5,5,5,0">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="140" />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <Label Grid.Column="0" Content="Reset Password From"/>
                                            <TextBox Grid.Column="1" Text="{Binding ActiveEntity.ResetPasswordEmailFromAddress}" />
                                        </Grid>
                                        <Grid Grid.Row="2" Margin="5,5,5,0">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="140" />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <Label Grid.Column="0" Content="Reset Password Subject"/>
                                            <TextBox Grid.Column="1" Text="{Binding ActiveEntity.ResetPasswordEmailSubject}" />
                                        </Grid>
                                        <Grid Grid.Row="3" Margin="5,5,5,5">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="140" />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>

                                            <Label Content="Reset Password Body"/>
                                            <TextBox Grid.Column="1" Text="{Binding ActiveEntity.ResetPasswordEmailBody}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" />
                                        </Grid>
                                    </Grid>
                                </ContentControl>
                            </TabItem>
                            <TabItem Header="Plugins" FontWeight="Bold">
                                <ContentControl FontWeight="Normal">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition/>
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>

                                        <Grid>
                                            <Grid.Background>
                                                <SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
                                            </Grid.Background>
                                            <StackPanel Orientation="Horizontal">
                                                <Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.IdentityManager.UI.Wpf;component/Images/Add.png" 
                                                    ToolTip="Add Plugin" ButtonCommand="{Binding AddPluginCommand}" />
                                            </StackPanel>
                                        </Grid>
                                        <DataGrid Grid.Row="1" RowHeaderWidth="0" ItemsSource="{Binding ActiveServerItem.Plugins}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeColumns="False" CanUserReorderColumns="False" SelectedItem="{Binding ActivePlugin}">
                                            <DataGrid.Columns>
                                                <DataGridTemplateColumn Width="*" Header="Name" SortMemberPath="Name">
                                                    <DataGridTemplateColumn.CellTemplate>
                                                        <DataTemplate>
                                                            <TextBox Text="{Binding TypeName, Mode=OneWay, UpdateSourceTrigger=LostFocus}" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" />
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellTemplate>
                                                </DataGridTemplateColumn>
                                                <DataGridTemplateColumn Width="55" Header="Edit" SortMemberPath="EditIsEnabled">
                                                    <DataGridTemplateColumn.CellTemplate>
                                                        <DataTemplate>
                                                            <CheckBox IsChecked="{Binding EditIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellTemplate>
                                                </DataGridTemplateColumn>
                                                <DataGridTemplateColumn Width="55" Header="Filter" SortMemberPath="FilterIsEnabled">
                                                    <DataGridTemplateColumn.CellTemplate>
                                                        <DataTemplate>
                                                            <CheckBox IsChecked="{Binding FilterIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellTemplate>
                                                </DataGridTemplateColumn>
                                                <DataGridTemplateColumn Width="35" IsReadOnly="True">
                                                    <DataGridTemplateColumn.CellTemplate>
                                                        <DataTemplate>
                                                            <Button Command="{Binding DataContext.DeletePluginCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:UserConfigurationView}}}" 
                                                                CommandParameter="{Binding}" ToolTip="Delete">
                                                                <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Delete.png" Width="24"/>
                                                            </Button>
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellTemplate>
                                                </DataGridTemplateColumn>
                                            </DataGrid.Columns>
                                        </DataGrid>
                                        <Grid Grid.Row="2" IsEnabled="{Binding CanEditPlugin}">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>

                                            <Controls:SubHeaderControl HeaderCaption="{Binding ActivePluginName}" Margin="0,5,0,0" />
                                            <Grid Grid.Row="1" Margin="5,5,5,0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="130" />
                                                    <ColumnDefinition />
                                                    <ColumnDefinition Width="36" />
                                                </Grid.ColumnDefinitions>

                                                <Label Grid.Column="0" Content="Type"/>
                                                <TextBox Grid.Column="1" Text="{Binding ActivePlugin.TypeName}" TextWrapping="Wrap" Height="40" VerticalScrollBarVisibility="Visible" />
                                                <Controls:ButtonControl Grid.Column="2" ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.IdentityManager.UI.Wpf;component/Images/Open.png" 
                                            ToolTip="Select file" ButtonCommand="{Binding OpenFileCommand}" ButtonCommandParameter="1" />
                                            </Grid>
                                            <Grid Grid.Row="2" Margin="5,5,5,5">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="130" />
                                                    <ColumnDefinition />
                                                    <ColumnDefinition Width="36" />
                                                </Grid.ColumnDefinitions>

                                                <Label Grid.Column="0" Content="Context"/>
                                                <TextBox Grid.Column="1" Text="{Binding ActivePlugin.Context}" TextWrapping="Wrap" Height="60" VerticalScrollBarVisibility="Visible" />
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </ContentControl>
                            </TabItem>
                        </TabControl>
                    </Grid>
                    <Grid Grid.Row="2" Margin="5,5,5,5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Button Grid.Column="0" Command="{Binding ConnectToServerCommand}" IsEnabled="{Binding CanConnectToServer}" Padding="10,1">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/ConnectToServer.png" Width="24"/>
                                <TextBlock Grid.Column="1" Text="Connect to server" Margin="5,0,0,0" HorizontalAlignment="Center" />
                            </Grid>
                        </Button>
                        <Button Grid.Column="1" Command="{Binding SaveCommand}" IsEnabled="{Binding IsSavable}" Padding="10,1" Margin="5,0,0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Save.png" Width="24"/>
                                <TextBlock Grid.Column="1" Text="Save" Margin="5,0,0,0" />
                            </Grid>
                        </Button>
                        <Button Grid.Column="3" Command="{Binding ExportSettingsCommand}" Padding="10,1" Margin="5,0,0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Export.png" Width="24"/>
                                <TextBlock Grid.Column="1" Text="Export" Margin="5,0,0,0" />
                            </Grid>
                        </Button>
                        <Button Grid.Column="4" Command="{Binding ImportSettingsCommand}" Padding="10,1" Margin="5,0,0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Import.png" Width="24"/>
                                <TextBlock Grid.Column="1" Text="Import" Margin="5,0,0,0" />
                            </Grid>
                        </Button>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
        <xctk:WindowContainer ModalBackgroundBrush="#80000000" Visibility="{Binding ClassDialogIsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
            <xctk:ChildWindow WindowStartupLocation="Center" WindowState="Open" IsModal="True" Width="600" Height="400">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <Grid>
                        <Grid.Background>
                            <SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
                        </Grid.Background>
                        <StackPanel Orientation="Horizontal">
                            <Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.IdentityManager.UI.Wpf;component/Images/OK.png" 
                                ToolTip="OK" ButtonCommand="{Binding SelectFileNameCommand}" />
                            <Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.IdentityManager.UI.Wpf;component/Images/Cancel.png" 
                                ToolTip="Cancel" ButtonCommand="{Binding CloseFileNameDialogCommand}" />
                        </StackPanel>
                    </Grid>

                    <DataGrid Grid.Row="1" ItemsSource="{Binding ClassNames}" RowHeight="55" AutoGenerateColumns="False" HeadersVisibility="None" CanUserReorderColumns="False" CanUserResizeColumns="False"
                        CanUserResizeRows="False" CanUserSortColumns="False" SelectionMode="Single" CanUserAddRows="False" SelectedItem="{Binding ActiveClassname, Mode=TwoWay}" AllowDrop="True">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseDoubleClick">
                                <i:InvokeCommandAction Command="{Binding SelectFileNameCommand}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="*" Binding="{Binding Path={}, Mode=OneWay}" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </xctk:ChildWindow>
        </xctk:WindowContainer>
    </Grid>
</views:MvxWpfView>
